//
//  ContentView.swift
//  SwiftUIExample
//
//  Created by qingzhou on 2021/6/17.
//

import SwiftUI

@available(iOS 15.0, *)
struct ContentView: View {
    @State var selection:Int = 1
    var body: some View {
        
        TabView(selection: $selection) {
            
            IndexView()
            
            .tabItem {
                Label("首页",systemImage: "house.fill")
            }
            .badge(5)
            .tag(1)
            
            
            SecondView()
            .tabItem {
                Label("我的",systemImage: "person.fill")
            }
            .badge(2)
            .tag(2)
            
            NavigationView {
                ThirdView()
                    .navigationTitle("发现")
                    .navigationBarTitleDisplayMode(.inline)
            }
            .tabItem{
                Label("发现",systemImage: "clock")
            }
            .badge(1)
            .tag(3)
        }
    }
}



@available(iOS 15.0, *)
struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
